package com.wavecoler.professor.objects;

import java.io.Serializable;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;
//import com.sun.xml.internal.rngom.parse.Parseable;

@PersistenceCapable
public class Advice implements Serializable {
	
	 //feedback
	   public static final String ASK_FOR_FEEDBACK = "AF";
	   public static final String GIVE_FEEDBACK = "GF";
	   public static final String WAIT_FOR_FEEDBACK = "WF";
	   
	 //discussion
	   public static final String ANALYZE_ALTERNATIVES = "AA";
	   public static final String EXPRESS_UNCERTAINTY = "EU";
	   public static final String EXPRESS_DISAGREEMENT = "ED";
	   public static final String ASK_FOR_EXPLANATION = "AE";
	   public static final String ASK_FOR_JUSTIFICATION = "AJ";
	   public static final String GIVE_EXPLANATION = "GE";
	   public static final String REFLECT_ABOUT = "RA";
	   public static final String GIVE_JUSTIFICATION = "GJ";
	   
	 //Participation
	   public static final String GENERAL_CONTRIBUTION = "GC";
	   public static final String SPECIFIC_CONTRIBUTION = "SC";
	   public static final String GENERAL_PARTICIPATION = "GP";
	   public static final String INVITATE_OTHERS_TO_PARTICIPATE = "IP";
	   public static final String LISTEN_TO_OTHERS = "LO";
	   public static final String LET_THEM_PARTICIPATE = "LP";
	   public static final String LISTEN_TO_OTHERS_MANDATORY = "LM";
	   public static final String CONTINUE_TASK = "CT";
	   public static final String ASK_LET_YOU_CONTRIBUTE = "LC";
	   
	 //Self-Reflection
	   public static final String SELF_REFLECTION = "SR";
	   
	 //Check own Discrepancies
	   public static final String CHECK_OWN_DISCREPANCIES = "CD";
	   
	 //Entity-RelationshipModeling
	   public static final String ENTITY_RELATIONSHIP_MODELING = "ER";
	   public static final String REVIEW_YOUR_WORK = "RW";
	   
	 //Welcome and GoodBye messages
	   public static final String INDIVIDUAL_WELCOME = "IW";
	   public static final String GROUP_WELCOME = "GW";
	   public static final String INDIVIDUAL_GOODBYE = "IG";
	   public static final String GROUP_GOODBYE = "GG";
	   
	 //constant for kind of advice
	   public static final String PRIVATE_ADVICE = "P";
	   public static final String GROUP_ADVICE = "G";
	   
	   
	   @PrimaryKey
	   @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	   private Key adviceId;
	   
	   @Persistent
	   private String adviceNum;
	   
	   @Persistent
	   private String adviceText;
	   
	   @Persistent
	   private AdviceType adviceType;
	   
	   @Persistent
	   private String phaseSession;
	   
	   @Persistent
	   private String adviceKind;
	   
	   
	   public Advice(String adviceNum, String adviceText, AdviceType adviceType, String phaseSession, String adviceKind) {
			super();
			this.adviceNum = adviceNum;
			this.adviceText = adviceText;
			this.adviceType = adviceType;
			this.phaseSession = phaseSession;
			this.adviceKind = adviceKind;
		}

	   
	   public Key getAdviceId() {
			return adviceId;
		}
	   
	   public String getAdviceNum() {
		   return adviceNum;
	   } 
	   
	   public String getAdviceText() {
			return adviceText;
		}
	   
	   public AdviceType getAdviceType() {
			return adviceType;
		}
		
		public String getPhaseSession() {
			return phaseSession;
		}
		
		public String getAdviceKind() {
			return adviceKind;
		}
		
		public void setAdviceNum(String adviceNum) {
			this.adviceNum = adviceNum;
		   } 
		   
		public void setAdviceText(String adviceText) {
			this.adviceText = adviceText;
		}
		public void setAdviceType(AdviceType adviceType) {
			
			this.adviceType = adviceType;
		}
		
		public void setPhaseSession(String phaseSession) {
			this.phaseSession = phaseSession;
		}
		
		public void setAdviceKind(String adviceKind) {
			this.adviceKind = adviceKind;
		}
	   
	   public boolean isPrivateAdvice() {
		   return (adviceKind.equals(PRIVATE_ADVICE));
	   }

	   public boolean isGroupAdvice() {
		   return (adviceKind.equals(GROUP_ADVICE));
	   }
	   
/*	   public boolean isNew(AdviceHistory history) {
		     if (history.isNew(typeAdvice))  {
		        System.out.println("Advice Type is New "+typeAdvice);
		        System.out.flush();
		        return true;
		     }
		     else {
		       System.out.println("Advice Type is Not New "+typeAdvice);
		       System.out.flush();
		       return false;
		     }
		   } */
}
